package com.zeus.mq.convert;

import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Configuration;


/**
 * @author magic
 * @date 2018/9/4/004 17:04
 * @version 1.0
 * Description MessageConvertAutoConfiguration
 */
@Configuration
public class MessageConvertAutoConfiguration {

    @ConditionalOnBean({ConnectionFactory.class,RabbitTemplate.class})
    public MessageConverter messageConverter(){
        return new Jackson2JsonMessageConverter();
    }

}
